package com.yuyou.tas.lesson.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.tas.lesson.service.ILessonResourceService;
import com.yuyou.tas.service.api.lesson.entity.LessonResource;
import com.yuyou.tas.service.api.lesson.service.LessonResourceAPI;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

@RestController
public class LessonResourceAPIImpl implements LessonResourceAPI{

	@Autowired
	private ILessonResourceService lessonResourceService;

	@Override
	public LessonResource selectByResourceId(@RequestParam("resourceId") String resourceId) {
		return lessonResourceService.selectByResourceId(resourceId);
	}

	@Override
	public LessonResource selectById(@RequestParam("id") Long id) {
		return lessonResourceService.selectByPrimaryKey(id);
	}

	@Override
	public List<LessonResource> selectTemps() {
		return lessonResourceService.selectTemps();
	}

	@Override
	public void delByResourceIds(String[] id) {
		lessonResourceService.delByResourceIds(id);
	}

	@Override
	public ResBoolSimpleInfo<String> addResourceTemp(
			@RequestParam("resourceId")String resourceId,
			@RequestParam("organizationId")Long organizationId,
			@RequestParam(value="lessonClassId",required =false)Long lessonClassId, 
			@RequestParam("userId")Long userId) {
		return lessonResourceService.addResourceTemp(resourceId, organizationId, lessonClassId, userId);
	}
	



	
}
